/*****************************************
 *                                       *
 *  @dookay.com Internet make it happen  *
 *  ----------- -----------------------  *
 *  dddd  ddddd Internet make it happen  *
 *  o   o     o Internet make it happen  *
 *  k    k    k Internet make it happen  *
 *  a   a     a Internet make it happen  *
 *  yyyy  yyyyy Internet make it happen  *
 *  ----------- -----------------------  *
 *  NO BUG ENJOY LIFE                    *
 *                                       *
 ****************************************/

package com.security.demo.controller;

import com.security.demo.domain.User;
import com.security.demo.service.UserInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 向羽
 * @date 2018/8/27
 */
@RestController
@RequestMapping("/user")
@Slf4j
public class UserController {

    @Autowired
    private UserInfoService userInfoService;

    /**
     * @author 向羽
     * @date 2018/8/27
     * @description
     */
    @RequestMapping(value = "/info", method = RequestMethod.GET)
    public User info(User user){
        return user;
    }

    /**
     * @author 向羽
     * @date 2018/8/27
     * @description
     */
    @RequestMapping(value = "/getDetail", method = RequestMethod.GET)
    public User get(@RequestParam String username){
        return userInfoService.getUserInfo(username);
    }

}
